package UntilSolr;

import org.apache.solr.client.solrj.impl.CloudSolrServer;

public class UntilSolrCloud {
    //单一节点
    //private String solrUrl = "CDH-master:2181/solr/hbaseSolr";
    //solr cloud
    private static String zkHost = "CDH-master:2181,CDH-slave1:2181,CDH-slave2:2181/solr";
    private static String collection = "hbaseSolr";

//    public HttpSolrServer getSolr() {
//        return new HttpSolrServer(solrUrl);
//    }

    public static CloudSolrServer getCollection() {
        CloudSolrServer solrServer = new CloudSolrServer(zkHost);
        solrServer.setDefaultCollection(collection);
        return solrServer;
    }
}